/*
********************************************************************************
* Copyright (C) 2021, xiang.D <dx_65535@163.com>.
* All right reserved.
*
* File Name   : bridge_v1.cc
* Author      :
* Version     : V1.0
* Description :
* Journal     : 2021-10-30 init v1.0
* Brief       : Blog: https://blog.csdn.net/qq_38750572?spm=1001.2014.3001.5343
* Others      :
                Compile command: g++ -Wl,--no-as-needed -std=c++11 bridge.cc
********************************************************************************
*/
#include <iostream>
#include <string>

using namespace std;

class CApp
{
public:
    CApp(string logo)
    {
        mLogo = logo;
    }

    ~CApp()
    {

    }

    void ShowLogo()
    {
        cout << mLogo << endl;
    }

private:
    string mLogo;
};

class CPhone
{
public:
    void InstallApp(CApp *pApp)
    {
        mApp = pApp;
    }

    void EnterApp()
    {
        mApp->ShowLogo();
    }

private:
    CApp *mApp;
};

int main(int argc, char *argv[])
{
    CApp theHonorofKings("Timi");
    CPhone thePhone;

    thePhone.InstallApp(&theHonorofKings);
    thePhone.EnterApp();

    return 0;
}
